use crate::cli::messages::{push_message, Type};

/// 初始化
pub fn init() -> anyhow::Result<()> {
    let start_time = std::time::Instant::now();
    println!("Hello, world!");
    let end_time = start_time.elapsed();
    if end_time.as_millis() == 0 {
        push_message(
            Type::Info,
            &format!("生成在 {}μs 内完成⚡", end_time.as_micros()),
        )
    } else {
        push_message(
            Type::Info,
            &format!("生成在 {}ms 内完成⚡", end_time.as_millis()),
        )
    }
    Ok(())
}
